import React from 'react'
import {List} from 'antd-mobile'
import ContactsListItem from "./ContactsListItem/ContactsListItem";
import {SearchBar} from "antd-mobile";

interface IProps {
    List: Array<any>
    ListType: string
}

const ContactsList = (props: IProps) => {
    return (
        <div>
            <SearchBar placeholder='搜索'/>
            <List>
                {
                    props.ListType === 'friend' ?
                        props.List.map(item => {
                            return <ContactsListItem key={item.uUid} uUid={item.uUid} uNickName={item.uNickName} type='friend' avator={item.avator}/>
                        })
                        :
                        (
                            <>
                                <ContactsListItem type='group'/>
                                <ContactsListItem type='group'/>
                                <ContactsListItem type='group' />
                                <ContactsListItem type='group'/>
                                <ContactsListItem type='group'/>
                            </>
                        )
                }

            </List>
        </div>
    )
}

export default ContactsList